home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / docdem.arc / MATHDLL.PAS < prev    next >
Pascal/Delphi Source File  |  1991-07-20  |  1KB  |  45 lines

  1. {************************************************}
  2. {                                                }
  3. {   Turbo Pascal for Windows                     }
  4. {   Demo Dynamic Link Library                    }
  5. {   Copyright (c) 1991 by Borland International  }
  6. {                                                }
  7. {************************************************}
  8.  
  9. library MathDll;
  10.  
  11. uses WinTypes, WinProcs;
  12.  
  13. function Power(X, Y: Real): Real; export;
  14. begin
  15.   Power:=Exp(Y * ln(X));
  16. end;
  17.  
  18. function Payments(Period, Interest, Term, Principal: Real): Real; export;
  19. begin
  20.   Payments := (Principal * Interest / Period) /
  21.     (1 - Power(1 + Interest / Period, -Term * Period));
  22. end;
  23.  
  24. function Principals(Payment, Period, Interest, Term: Real): Real; export;
  25. begin
  26.   Principals := Payment * ((1 - Power(1 + Interest / Period,
  27.     -Term * Period)) / (Interest / Period));
  28. end;
  29.  
  30. procedure WriteError(Window: hWnd; ErrorMessage: PChar); export;
  31. var
  32.   S: String;
  33. begin
  34.   MessageBox(Window, ErrorMessage, 'Error', MB_OK);
  35. end;
  36.  
  37. exports
  38.   Power        index 1,
  39.   Payments     index 2,
  40.   Principals   index 3,
  41.   WriteError   index 4;
  42.  
  43. begin
  44. end.
  45.